home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / FPGAWKII.ZIP / INCRMNTR.PDS < prev    next >
Text File  |  1994-10-05  |  1KB  |  29 lines

  1. ;*-- beginning of the incrementer module -----------------
  2. ; This is a module which increments its 3-bit input.
  3. ; It also has a reset input which forces all its outputs
  4. ; to zero.
  5. ;---------------------------------------------------------
  6. DEFMOD incrmntr( rst, cur[0:2], nxt[0:2] )
  7. CHIP    incrmntr  Intel_arch
  8. PIN     rst            ;* reset counter to 0 (input)
  9. PIN     cur[0:2]       ;* current counter value (input)
  10. PIN     nxt[0:2]       ;* next counter value (output)
  11.  
  12. ; the 3-bit incrementer is specified using the following
  13. ; truth table.  note the first entry which says that the
  14. ; output will be all zeroes if the rst input is high
  15. ; regardless of what values the other inputs have (don't
  16. ; cares are signified by an "x").
  17. T_TAB( rst cur2 cur1 cur0 >> nxt2 nxt1 nxt0 )
  18.         1   x    x    x   :   0    0    0   ;* reset to 0
  19.         0   0    0    0   :   0    0    1   ;* 0 -> 1
  20.         0   0    0    1   :   0    1    0   ;* 1 -> 2
  21.         0   0    1    0   :   0    1    1   ;* 2 -> 3
  22.         0   0    1    1   :   1    0    0   ;* 3 -> 4
  23.         0   1    0    0   :   1    0    1   ;* 4 -> 5
  24.         0   1    0    1   :   1    1    0   ;* 5 -> 6
  25.         0   1    1    0   :   1    1    1   ;* 6 -> 7
  26.         0   1    1    1   :   0    0    0   ;* 7 -> 0
  27. ENDMOD
  28. ;*-- end of the incrementer module ----------------------
  29.